/*
 * File:   Network.h
 * Author: henrya
 *
 * Created on June 13, 2009, 8:43 PM
 */

#ifndef _NETWORK_H
#define	_NETWORK_H
#include <string>
#include <fstream>
#include <map>
#include <vector>

#include "Mailer.h"
using std::ifstream;
using std::string;
using std::map;
using std::vector;
class Network {
public:
    Network();
    virtual ~Network();
    int getNodesCount();
    void printRTs();
    vector<int> *getNodeIds();
    Node* getNode(int id);
    Node* getNodeAt(unsigned int index);
    void startNodes();
private:
    vector<int> nodesIds;
    int nodeCount;
    map<int, Node*> nodes;
public:
    static Network* createNetwork(ifstream& fileName, Shell* shell,Mailer* mailer);
    bool checkAllNodesStable();
    void killAll();
    void killNode(int nodeId);
};

#endif	/* _NETWORK_H */

